<template>
  <div class="axios">
    <p class="axios-title">axios</p>
    <p class="axios-title">{{ name }}</p>
  </div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue'
import axios from '../utils/axios'

export default defineComponent({
  setup() {
    const name = ref('')
    axios
      .get('/users/weedwong')
      .then((res) => {
        name.value = res.data.name
      })
      .catch((err) => {
        console.log('err: ', err)
      })
    return {
      name
    }
  }
})
</script>

<style lang="less">
.axios {
  color: #333;
  &-title {
    font-size: 18px;
  }
}
</style>
